﻿using Core.Caching;

namespace Core.Identity.Roles.Caching;

public static class RolesCacheKey
{
    public const string GetAllCacheKey = "all-roles";

    public static string GetPaginationCacheKey(string parameters)
    {
        return $"RolesCacheKey:RolesWithPaginationQuery,{parameters}";
    }

    public static string GetRoleMenusByIdCacheKey(string parameters)
    {
        return $"RolesCacheKey:GetRoleMenusByIdQuery,{parameters}";
    }

    public static IEnumerable<string>? Tags => new string[] { "role" };

    public static void Refresh()
    {
        CacheFactory.RemoveByTags(Tags);
    }
}
